Cannot find module .-data.json. Consider using --resolveJsonModule to import module with .json extension

201

Cannot find module './data.json'. Consider using '--resolveJsonModule' to import module with '.json' extension -

add to tsconfig.json

{
	...
    "resolveJsonModule": true
  }
}

how to import a json string from a file in typescript -

import {default as a} from "a.json";
a.primaryMain

Comments

Submit
0 Comments